﻿using Mathmall.Administration.common;
using Mathmall.Administration.Models;

namespace Mathmall.Administration.Service
{
    public interface ICategoryService
    {
        /// <summary>
        /// 创建商品分类
        /// </summary>
        /// <param name="categoryVo"></param>
        /// <returns></returns>
        Task<int> AddCategory(CategoryVo categoryVo);

        /// <summary>
        /// 查询分类信息，以树形结构返回
        /// </summary>
        /// <param name="parentCategoryId">父分类id</param>
        List<CategoryVo> QueryCategoryVosByParentId(int? parentCategoryId);

        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="pageNumber"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        Task<PaginatedList<CategoryVo>?> PaginatedQuery(int pageNumber, int pageSize);

        /// <summary>
        /// 递归查询全部分类，以树形结构返回
        /// </summary>
        /// <returns></returns>
        Task<List<CategoryVo>> QueryAllCategories();

        /// <summary>
        /// 更新分类信息
        /// </summary>
        /// <param name="categoryVo"></param>
        /// <returns></returns>
        Task<int> UpdateCategory(CategoryVo categoryVo);

        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="categoryIdList"></param>
        /// <returns></returns>
        Task<int> DeleteCategories(List<int> categoryIdList);

        /// <summary>
        /// 查询分类的完整路径，返回结果为id数组
        /// </summary>
        /// <param name="categoryID"></param>
        /// <returns></returns>
        Task<List<int>> GetCategoryIdPath(int categoryID);

        /// <summary>
        /// 根据分类id查询分类信息
        /// </summary>
        /// <param name="categoryId"></param>
        /// <returns></returns>
        Task<Category> GetCategoryById(int categoryId);

        /// <summary>
        /// 用循环返回树形结构
        /// </summary>
        /// <returns></returns>
        Task<List<CategoryVo>> GetAllCategoryVos();
    }
}